package com.lbh.time;

/***
 * project:JRuntime
 * package:com.lbh.time
 *
 * @author user:lenovo QQ:1601078366
 * @date 2021/10/22 1:32
 * @version V1.0
 */
public class Time {

    public static float time = 0.0F;
    public static float deltaTime = 0.0F;

    public static void reset(){
        time = getTime();
        deltaTime = 0.0F;
    }

    public static void update(){
        float tmp = getTime();
        deltaTime = tmp - time;
        time = tmp;
    }

    public static float getTime(){
        return System.nanoTime() / 1e9F;
    }
}
